//
//  StrategyOtherDetailVC.m
//  ErWa
//
//  Created by 王阳阳 on 16/3/11.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "StrategyOtherDetailVC.h"
#import "NewNestHeader.h"
@interface StrategyOtherDetailVC ()
@property (nonatomic, strong) UIImageView *userImg;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIWebView *webView;
@end

@implementation StrategyOtherDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
      [self createSubviews];
}
/// 创建视图
- (void)createSubviews
{
    
    //创建webView
    self.webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    [self.view addSubview:_webView];
    _webView.scrollView.contentInset = UIEdgeInsetsMake(self.view.bounds.size.height / 8, 0, 0, 0);
    //创建一个View
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, - self.view.bounds.size.height / 8, self.view.bounds.size.width,  self.view.bounds.size.height / 8)];
    view.backgroundColor = [UIColor whiteColor];
    //头像
    self.userImg = [[UIImageView alloc] initWithFrame:CGRectMake(view.center.x - (view.frame.size.height / 2 - 10), 5, view.frame.size.height - 20, view.frame.size.height - 20)];
    _userImg.layer.cornerRadius = _userImg.frame.size.width / 2;
    _userImg.clipsToBounds = YES;
    [view addSubview:_userImg];
    //名字
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(view.frame.size.width / 1.5, _userImg.frame.size.height, view.frame.size.width - _userImg.frame.size.width - 10, _userImg.frame.size.height)];
    [view addSubview:_titleLabel];
    
    [self.webView.scrollView addSubview:view];
    
    // 给各部分赋值
    [_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_modal.share_link]]];
    _titleLabel.text = _modal.name;
    [_userImg sd_setImageWithURL:[NSURL URLWithString:_modal.imgUrl]];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
